<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视差案例</title>
    <style>
        *{
            margin: 0%;
            padding: 0%;
        }
        div{
            height: 2500px;
            background-position: center;
            background-size: cover;
            background-attachment: fixed;
        }
        .box1{
            background-image: url(image/bg1.png);
        }
        .box2{
            background-image: url(image/bg2.png);
        }
        .box3{
            background-image: url(image/bg3.png);
        }
        /* background-position: center 背景的位置居中
        background-size：cover（覆盖）
        background-attachment：fixed（在屏幕中固定） */
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</body>
</html>